﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Input;
using ZuesControls.Controls;

namespace ZuesControls.Event
{
    internal class InputEventRouter : IDisposable
    {
        protected ZSTreeView treeView;
        private List<InputSubscriberBase> inputSubscribers;

        public InputEventRouter(ZSTreeView treeView)
        {
            inputSubscribers = new List<InputSubscriberBase>(2);
            this.treeView = treeView;

            treeView.MouseDown += OnMouseDown;
            treeView.MouseMove += OnMouseMove;
            treeView.MouseUp += OnMouseUp;
            treeView.ScrollViewer.ScrollChanged += OnScrollChanged;
        }


        public void Dispose()
        {
            if (treeView != null)
            {
                treeView.MouseDown -= OnMouseDown;
                treeView.MouseMove -= OnMouseMove;
                treeView.MouseUp -= OnMouseUp;
                treeView.ScrollViewer.ScrollChanged -= OnScrollChanged;

                treeView = null;
            }

            if (inputSubscribers != null)
            {
                inputSubscribers.Clear();
                inputSubscribers = null;
            }

            GC.SuppressFinalize(this);
        }

        private void OnScrollChanged(object sender, ScrollChangedEventArgs e)
        {
           
        }

        private void OnMouseUp(object sender, MouseButtonEventArgs e)
        {
          
        }

        private void OnMouseMove(object sender, MouseEventArgs e)
        {
            
        }

        private void OnMouseDown(object sender, MouseButtonEventArgs e)
        {
           
        }
    }
}
